import type { CustomerTransferHistoryVO, CustomerTransferHistoryForm, CustomerTransferHistoryQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询客户迁移历史列表
* @param params
* @returns 客户迁移历史列表
*/
export function customerTransferHistoryList(params?: CustomerTransferHistoryQuery) {
  return requestClient.get<PageResult<CustomerTransferHistoryVO>>('/hm/customerTransferHistory/list', { params });
}

/**
 * 导出客户迁移历史列表
 * @param params
 * @returns 客户迁移历史列表
 */
export function customerTransferHistoryExport(params?: CustomerTransferHistoryQuery) {
  return commonExport('/hm/customerTransferHistory/export', params ?? {});
}

/**
 * 查询客户迁移历史详情
 * @param id id
 * @returns 客户迁移历史详情
 */
export function customerTransferHistoryInfo(id: ID) {
  return requestClient.get<CustomerTransferHistoryVO>(`/hm/customerTransferHistory/${id}`);
}

/**
 * 新增客户迁移历史
 * @param data
 * @returns void
 */
export function customerTransferHistoryAdd(data: CustomerTransferHistoryForm) {
  return requestClient.postWithMsg<void>('/hm/customerTransferHistory', data);
}

/**
 * 更新客户迁移历史
 * @param data
 * @returns void
 */
export function customerTransferHistoryUpdate(data: CustomerTransferHistoryForm) {
  return requestClient.putWithMsg<void>('/hm/customerTransferHistory', data);
}

/**
 * 删除客户迁移历史
 * @param id id
 * @returns void
 */
export function customerTransferHistoryRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/hm/customerTransferHistory/${id}`);
}
